package dnuifood_cjy.dnuifood_16110100529.model;

import dnuifood_cjy.dnuifood_16110100529.iface.ShopIface;
import dnuifood_cjy.dnuifood_16110100529.listener.OnRetrofitListener;
import dnuifood_cjy.dnuifood_16110100529.service.ShopService;

import retrofit2.Call;

public class ShopModel extends BaseModel implements ShopIface {

    private ShopService shopService;
    private String flag;

    public ShopModel(){
        shopService=retrofit.create(ShopService.class);

    }
    public  void  getAllShops(OnRetrofitListener listener){
        Call call=shopService.getAllshops();
        bindCallback(call,listener,1);
    }

    @Override
    public void getFoodByShop(String shop_id, OnRetrofitListener listener) {
        Call call=shopService.getFoodByShop(shop_id);
        bindCallback(call,listener,2);
    }


    @Override
    public void isCollected(String user_id, String shop_food_id, String flag, OnRetrofitListener listener) {
        Call call=shopService.isCollected(user_id,shop_food_id,flag);
        bindCallback(call,listener,3);
    }

    @Override
    public void userCollectShop(String user_id, String shop_id, OnRetrofitListener listener) {
        Call call=shopService.userCollectShop(user_id,shop_id);
        bindCallback(call,listener,4);
    }
}
